V8_INC=/home/pavel/AMSE/v8/v8/include
V8_LIB=/home/pavel/AMSE/v8/v8/libv8.a 

all: cityPlacesParser

cityPlacesParser: main.o comment.o place.o htmlWriter.o kmlWriter.o commentsLoader.o network.o commentsCacheLoader.o commentsWebLoader.o commentsCacheSaver.o geocoder.o jsEngine.o commentsProcessor.o
	g++ main.o comment.o place.o htmlWriter.o kmlWriter.o commentsLoader.o network.o commentsCacheLoader.o commentsWebLoader.o commentsCacheSaver.o geocoder.o jsEngine.o commentsProcessor.o -o cityPlacesParser $(V8_LIB) -lpthread

main.o: main.cpp
	g++ -c main.cpp

commentsLoader.o: commentsLoader.cpp
	g++ -c commentsLoader.cpp 

commentsCacheLoader.o: commentsCacheLoader.cpp
	g++ -c commentsCacheLoader.cpp 

commentsWebLoader.o: commentsWebLoader.cpp
	g++ -c commentsWebLoader.cpp 

commentsCacheSaver.o: commentsCacheSaver.cpp
	g++ -c commentsCacheSaver.cpp 

commentsProcessor.o: commentsProcessor.cpp
	g++ -c commentsProcessor.cpp 

network.o:
	g++ -c network.cpp 

geocoder.o: geocoder.cpp
	g++ -c geocoder.cpp

kmlWriter.o: kmlWriter.cpp
	g++ -c kmlWriter.cpp

htmlWriter.o: htmlWriter.cpp
	g++ -c htmlWriter.cpp

comment.o: comment.cpp
	g++ -c comment.cpp

place.o: place.cpp
	g++ -c place.cpp

jsEngine.o: jsEngine.cpp
	g++ -c -I$(V8_INC) jsEngine.cpp

run: cityPlacesParser
	./cityPlacesParser http://tema.livejournal.com/570773.html Санкт-Петербург

publish: 
	bash ./ftpSend

clean: 
	rm *.o result* cityPlacesParser

